import serve from './index'
// 按需导出

// 获取页码数
export function getPages(name) {
    return serve({
        url: '/admin/department/page/count',
        method: 'GET',
        params: {
            name:name
        }
    })
}

// 搜索
export function getList(data, page) {
    return serve({
        url: '/admin/department/page/' + page,
        method: 'get',
        params: data
    })
}

// 添加
export function ADDList(name) {
    return serve({
        url: '/admin/department',
        method: 'post',
        data: {
            name: name,
            id: -1
        }
    })
}

// 更改
export function changeorno(name, id) {
    return serve({
        url: '/admin/department',
        method: 'put',
        data: {
            name: name,
            id: id
        }
    })
}

// 删除
export function deleted( id) {
    return serve({
        url: '/admin/department/'+id,
        method: 'delete',
    })
}